/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lolbuilder.mainClasses;

import java.util.ArrayList;
import lolbuilder.Champions.Impl.Ashe;
import lolbuilder.Champions.Impl.KogMaw;
import lolbuilder.Champions.Impl.MissFortune;
import lolbuilder.Champions.Impl.Vayne;
import lolbuilder.Champions.Interf.DummyChamp;
import lolbuilder.masteries.BestDpsMasteriesChoose;
import lolbuilder.params.Parameters;
import lolbuilder.runes.RunesCompoCalculator;

/**
 *
 * @author chocoboSan
 */
public class WhoIsDaOpCarry {
    public static void main(String[] args) {
        BestDpsMasteriesChoose.main(args);
        RunesCompoCalculator.main(args);
        
        ArrayList<DummyChamp> adCarries=new ArrayList<DummyChamp>();
        adCarries.add(new MissFortune());
        adCarries.add(new KogMaw());
        adCarries.add(new Ashe());
        adCarries.add(new Vayne());
        
        int max_vict=0;
        DummyChamp bestCarry=null;
        
        for (DummyChamp d : adCarries) {
            int nb_vict=0;
            for (DummyChamp d2 : adCarries) {
                if (d.equals(d2)) continue;
                d.resetStats();
                d2.resetStats();
                Parameters.r.addAllBonus(d);
                Parameters.mbc.applyMasteries(d);
                Parameters.r.addAllBonus(d2);
                Parameters.mbc.applyMasteries(d2);
                float step=(float) 0.1;
                while (d.curHp>0 && d2.curHp>0) {
                    float MgcDamage1=d.calculateMyMagicDmgForThisNumberOfSecOnThisTarget(d2, step);
                    float MgcDamage2=d2.calculateMyMagicDmgForThisNumberOfSecOnThisTarget(d, step);

                    float damage1=(d).calculateMyDmgsForThisNumberOfSecOnThisTarget(d2,step);

                    float damage2=(d2).calculateMyDmgsForThisNumberOfSecOnThisTarget(d,step);
                    float regenHp1PerStep=(((float)d.regenhp)/5)*step;
                    float regenHp2PerStep=(((float)d2.regenhp)/5)*step;


                    d.curHp=(int) (((float)d.curHp)-damage2-MgcDamage2);
                    d.curHp+=regenHp1PerStep;
                    if (d.ls>0) d.curHp+=((damage1*d.ls)/100);
                    if (d.sv>0) d.curHp+=((MgcDamage1*d.sv)/100);

                    d2.curHp=(int) (((float)d2.curHp)-damage1-MgcDamage1);
                    d2.curHp+=regenHp2PerStep;
                    if (d2.ls>0) d2.curHp+=(damage2*d2.ls/100);
                    if (d2.sv>0) d.curHp+=((MgcDamage1*d2.sv)/100);

                    
                    d.updateTick(step);
                    d2.updateTick(step);
                }
                if (d.curHp>d2.curHp) {
                    nb_vict++;
                    System.out.println(""+d+" beats "+d2);
                } else {
                    System.out.println(""+d2+" beats "+d);
                }
            }
            if (nb_vict>max_vict) {
                max_vict=nb_vict;
                bestCarry=d;
            }
        }
        System.out.println("best carry : "+bestCarry+" with note  "+max_vict);
    }
}
